# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=vmcloak
pkgver=955.fae1f29
pkgrel=4
epoch=2
pkgdesc='Automated Virtual Machine Generation and Cloaking for Cuckoo Sandbox.'
arch=('any')
groups=('blackarch-malware')
url='https://github.com/Cryss76/vmcloak'
license=('GPL3')
depends=('python' 'python-sphinx' 'python-lockfile' 'python-requests' 'lshw'
         'python-alembic' 'python-sqlalchemy' 'python-yaml' 'python-pefile'
         'python-jinja' 'python-click' 'python-psutil' 'dmidecode' 'cdrtools'
         'qemu-full')
makedepends=('git' 'python-setuptools' 'python-pytest')
source=("$pkgname::git+https://github.com/Cryss76/$pkgname.git"
        'setup.py.patch')
sha512sums=('SKIP'
            '6510c2bea8d448b537441dcd73398d14bfd0943d9d5b88be97e5ae0dc7a7101f33163ece04cba92a8709d7661618c801c1433963eea6f0425a562c92434276e3')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  cd $pkgname

  patch -p1 < ../setup.py.patch
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 docs/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

